<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<h1>People</h1>
		<ul>
			<li>
				<a href="files/richard.json">RICHARD</a>
			</li>
			<li>
				<a href="files/andy.json">! ! !</a>
			</li>
			<li>
				<a href="files/Jeremy.json">! ! !</a>
			</li>
		</ul>
		<div id="details"></div>
		
		<script type="text/javascript" src="js/jquery-1.12.4.js"></script>
		<script>
			"use strict"
			
			$(function(){
				$("a").click(function(){
					let url = this.href
					let args = {"time": new Date()}
					
//					$.getJSON(url, args, function(data){
//						let name = data.person.name
//						let email = data.person.email
//						let website = data.person.website
//						let text = "<h1>"
//										+ "账号: " + name + " <br />"
//										+ "邮箱: " + email + " <br />"
//										+ "主页: " + "<a href='" + website + "'>www.xchch.top</a>"
//									+ "</h1>"
//						$("#details").html(text)
//					})
//					return false

					$.get(url, args, function(data){
						let name = data.person.name
						let email = data.person.email
						let website = data.person.website
						let text = "<h1>"
										+ "账号: " + name + " <br />"
										+ "邮箱: " + email + " <br />"
										+ "主页: " + "<a href='" + website + "'>www.xchch.top</a>"
									+ "</h1>"
						$("#details").html(text)
					}, "json")
					return false
				})
			})
		</script>
	</body>
</html>
